<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="x" uri="/WEB-INF/tags/coretag.tld" %>
<%@ taglib prefix="u" tagdir="/WEB-INF/tags" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%@ include file="/WEB-INF/include/include.jsp" %>
  </head>
  <script type="text/javascript">
  	function testReload(){
  		var store=Ext.getCmp("mygrid").getStore();
  		var condition=new Condition("id","BFA349C381EC11E199B9180373D2396F");
  		store.clearCondition();
  		store.addCondition(condition);
  		//store.load({params:{conditions:[condition]}});
  		store.load();
  	}
  	
	function renderName(value){
		return '<font color=\'green\'>'+value+'</font>';
	};
  	
  </script>
  
  <body> 

  <div id="comboboxWrap1"></div>
  <div id="buttonWrap"></div>
  <div id="comboboxWrap2"></div>
   
  <u:page>
    <u:grid id="mygrid2"  datasetName="OappResourceDataSetHandler" fields="['id','resource_name','resource_type']"
  	handlerName="OappResourceLoadHandler" 
  	renderTo="comboboxWrap1"  showCheckbox="true" singleSelect="true" pageSize="2" editable="true"
  	 >
	  <x:columns>
	  	  <u:gridcolumn text="id" dataIndex="id" ></u:gridcolumn>
		  <u:gridcolumn text="名称" dataIndex="resource_name" renderer="renderName">
		  	<x:attr name="editor">
		  		<u:formPanel.text config="true"></u:formPanel.text>
		  	</x:attr>
		  </u:gridcolumn>
		  <u:gridcolumn text="类型" dataIndex="resource_type"></u:gridcolumn>
	  </x:columns>
  </u:grid>
  
  <u:grid id="mygrid"  datasetName="OappResourceDataSetHandler" fields="['id','resource_name','resource_type']" 
  	handlerName="OappResourceLoadHandler" 
  	handlerMethod="queryOne"
  	conditions='[{fieldName:\'id\',value:\'DCD8CC026E4711E19873180373D2396F\'}]'
  	renderTo="comboboxWrap2" 
  	autoLoad="true" >
	  <x:columns>
	  	  <u:gridcolumn text="id" dataIndex="id" hidden="true"></u:gridcolumn>
		  <u:gridcolumn text="名称" dataIndex="resource_name" renderer="renderName"></u:gridcolumn>
		  <u:gridcolumn text="类型" dataIndex="resource_type"></u:gridcolumn>
	  </x:columns>
  </u:grid>
  
  <u:button text="测试重新加载" handler="testReload"  renderTo="buttonWrap" ></u:button>
  
  </u:page>
  
  </body>
</html>
